<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%String path = request.getContextPath();%>
<html>
<head>
    <title>Title</title>
    <script>
        $(function (){
            $('#testfile').fileinput({
                language: 'zh',    							//汉化
                uploadUrl: '<%=path%>/player/upload',		//上传地址
                maxFileCount : 1,							//最大上传个数
                enctype : "multipart/form-data",			//预览
                maxFileSize : 10240,						//设置上传文件的大小
                allowedFileExtensions : ["gif", "jpeg", "jpg", "bmp", "png"],//限制上传类型
                browseClass: 'btn btn-primary',
                ErrMsg: "文件错误,图片类型必须是(gif,jpeg,jpg,bmp,png)中的一种",
                //下面几个就是初始化预览图片的配置
                initialPreviewAsData: true,//是否初始预览图片
                initialPreviewFileType: 'image',//回显文件类型（初始预览文件类型）
                initialPreview: "${relaxation.relaxationImg}",
            });

            //获取阿里云传回来的值
            $("#testfile").on("fileuploaded", function(event, data, previewId, index){
                var imgUrl = data.response.data;
                $("#relaxationImg").val(imgUrl);
            })
        })
    </script>
</head>
<body>
    <form role="form" id="rel_update_form">
        <input type="hidden" name="id" value="${relaxation.id}">
        <div class="form-group">
            <label for="relaxationName">摸鱼网址名:</label>
            <input type="text" class="form-control" id="relaxationName" name="relaxationName" placeholder="摸鱼网址名" value="${relaxation.relaxationName}">
        </div>

        <div class="form-group">
            <label for="relaxationHttp">网址链接:</label>
            <input type="text" class="form-control" id="relaxationHttp" name="relaxationHttp" placeholder="网址链接" value="${relaxation.relaxationHttp}">
        </div>

        <div class="form-group">
            <label for="relaxationRecommend">推荐指数(5~1级，5为最佳):</label>
            <input type="text" class="form-control" id="relaxationRecommend" name="relaxationRecommend" placeholder="推荐指数(5~1级，5为最佳)" value="${relaxation.relaxationRecommend}">
        </div>

        <div class="form-group">
            <label for="relaxationRcause">推荐原因:</label>
            <input type="text" class="form-control" id="relaxationRcause" name="relaxationRcause" placeholder="推荐原因" value="${relaxation.relaxationRcause}">
        </div>


        <div class="form-group" style="width:300px;height:300px">
            <label for="testfile">网址封面:</label>
            <input type="file"  id="testfile" name="image" multiple >
            <input type="hidden" name="relaxationImg" id="relaxationImg" value="${relaxation.relaxationImg}">
        </div>

    </form>
</body>
</html>
